<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
          $table->charset = 'utf8';
          $table->collation = 'utf8_general_ci';
          $table->increments('id',11)->comment("主键");
          $table->string('total_price',255)->comment("订单总价");
          $table->string('receiving_address',255)->comment("收货地址");
          $table->text('leaving_message')->comment("订单留言信息");
          $table->string('commodity_series_name')->nullable(true)->comment("系列型号名称");
          $table->string('commodity_series_id')->nullable(true)->comment("系列型号id");
          $table->string('commodity_id')->nullable(true)->comment("商品id");
          $table->string('img')->nullable(true)->comment("订单图片");
          $table->string('commodity_name')->nullable(true)->comment("商品名称");
          $table->string('member_preferences',255)->comment("会员优惠金额");
          $table->integer('user_id')->comment("下单用户id");
          $table->string('user_name',255)->comment("下单者名称");
          $table->string('order_number',255)->comment("订单号");
          $table->string('commodity_id',255)->comment("商品id");
          $table->string('commodity_name',255)->comment("商品名称");
          $table->string('package',255)->comment("预订单号");
          $table->string('commodity_series_id',255)->comment("商品型号id");
          $table->string('commodity_series_name',255)->comment("商品型号名称");
          $table->char('delivery_status',4)->comment("发货状态[0:未发货，1已发货]");
          $table->char('payment_status',4)->comment("付款状态[0:未付款，1已付款]");
          $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
